﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BuscarUsuario.aspx.cs" Inherits="BuscaUsuario" Title="Buscar Usuário" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="demoheading" style="width:400px">Buscar Usuário</div> 
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    
    <div style="width:400">
        <asp:Panel ID="Panel1" runat="server" CssClass="collapsePanelHeader" Height="20px" Width="400px">
            <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
            <div style="float: left;"></div>
            </div>
          </asp:Panel>
            
            <table style="width: 401px" class="divDados">
                <tr>
                    <td style="width: 138px">
                        <asp:Label ID="lblTipoDeConteudo" runat="server" Text="Tipo de Conteúdo:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTipoCont" runat="server">
                            <asp:ListItem Value="0">Selecione o Conteúdo</asp:ListItem>
                            <asp:ListItem Value="1">Arquivo de Áudio</asp:ListItem>
                            <asp:ListItem Value="2">Vídeo</asp:ListItem>
                            <asp:ListItem Value="3">Imagem</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 138px">
                        Nome:</td>
                    <td>
                        <asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="width: 138px">
                        <asp:Label ID="lblGenero" runat="server" Text="Gênero:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlGenero" runat="server" AppendDataBoundItems="True" 
                            DataSourceID="odsGenero" DataTextField="Nome" DataValueField="Codigo">
                            <asp:ListItem Selected="True" Value="0">Selecione o Genero</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsGenero" runat="server" 
                            DataObjectTypeName="Negocios.Genero" DeleteMethod="Remover" 
                            InsertMethod="Inserir" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="ConsultarTodos" TypeName="Negocios.GeneroBLL" 
                            UpdateMethod="Atualizar"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td style="width: 138px">
                        <asp:Label ID="lblAutor" runat="server" Text="Autor:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlAutor" runat="server" AppendDataBoundItems="True" 
                            DataSourceID="odsAutor" DataTextField="Nome" DataValueField="Codigo">
                            <asp:ListItem Selected="True" Value="0">Selecione um Autor</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsAutor" runat="server" 
                            DataObjectTypeName="Negocios.Autor" DeleteMethod="Remove" InsertMethod="Insere" 
                            OldValuesParameterFormatString="original_{0}" SelectMethod="ConsultaTodos" 
                            TypeName="Negocios.AutorBLL" UpdateMethod="Atualiza"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td style="width: 138px">
                        <asp:Label ID="lblFormato" runat="server" Text="Formato:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlFormato" runat="server" AppendDataBoundItems="True" 
                            DataSourceID="odsFormato" DataTextField="Nome" DataValueField="Codigo">
                            <asp:ListItem Selected="True" Value="0">Selecione um Formato</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsFormato" runat="server" 
                            DataObjectTypeName="Negocios.Formato" DeleteMethod="Remove" 
                            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="ConsultaTodos" TypeName="Negocios.FormatoBLL" 
                            UpdateMethod="Atualiza"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td style="width: 138px">
                        <asp:Label ID="lblSoftReproducao" runat="server" 
                            Text="Software para Reprodução:"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSwf" runat="server" 
                            DataSourceID="odsSoftReproducao" DataTextField="Nome" 
                            DataValueField="Codigo" AppendDataBoundItems="True">
                            <asp:ListItem Value="0" Selected="True">Selecione o Software de Reprodução</asp:ListItem>
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="odsSoftReproducao" runat="server" 
                            DataObjectTypeName="Negocios.SoftwareDeReproducao" DeleteMethod="Excluir" 
                            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
                            SelectMethod="ConsultaTodos" TypeName="Negocios.Software_De_ReproducaoBLL" 
                            UpdateMethod="Atualizar"></asp:ObjectDataSource>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" align="center" >
                        
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnCancelar" 
                            runat="server" Text="Cancelar" onclick="btnCancelar_Click" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button ID="btnPesquisar" 
                            runat="server" Text="Pesquisar" onclick="btnPesquisar_Click" 
                            style="height: 26px" />
                        &nbsp;
                        </td>
                    
                </tr>
            </table>
       
    
    </div>
    <br />
    <br />
    
    <div style="width:400">
       <asp:Panel ID="Panel2" runat="server" CssClass="collapsePanelHeader" Height="20px" Width="400px">
               <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
               <div style="float: left;">Resultado da Busca</div>
               </div>
         </asp:Panel>
        
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" DataSourceID="odsResultado">
            <Columns>
                <asp:BoundField DataField="Nome" HeaderText="Nome" SortExpression="Nome" />
            </Columns>
        </asp:GridView>
        
        <asp:ObjectDataSource ID="odsResultado" runat="server" 
            DataObjectTypeName="Negocios.Usuario" DeleteMethod="Remove" 
            InsertMethod="Insere" OldValuesParameterFormatString="original_{0}" 
            SelectMethod="BuscarGeral" TypeName="Negocios.UsuarioBLL" 
            UpdateMethod="Atualiza">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlTipoCont" Name="tipo" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="txtNome" Name="nome" PropertyName="Text" 
                    Type="String" />
                <asp:ControlParameter ControlID="ddlGenero" Name="genero" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlAutor" Name="autor" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlFormato" Name="formato" 
                    PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="ddlSwf" Name="swf" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
        
    </div>
</asp:Content>

